package net.orange.console.model.dataset;

import java.util.Comparator;

/**
 * The comparator for the console data.
 * 
 */
public class ConsoleDataComparator implements Comparator {

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Object arg0, Object arg1) {
		if (arg0 instanceof ConsoleData && arg0 instanceof ConsoleData
				&& arg0 != null && arg1 != null)
			return ((ConsoleData) arg0).getMetaData().getOrder()
					- ((ConsoleData) arg1).getMetaData().getOrder();
		else
			return 0;
	}

}
